package io.finer.erp.jeecg.finance.mapper;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import io.finer.erp.jeecg.finance.dto.FinaFurlDTO;
import io.finer.erp.jeecg.finance.dto.FinaFurlEntryDTO;
import io.finer.erp.jeecg.finance.dto.FinaFurlSumDTO;
import io.finer.erp.jeecg.finance.dto.FinaPaymentDto;
import io.finer.erp.jeecg.finance.dto.PaymentStatisticDTO;
import io.finer.erp.jeecg.finance.dto.ReceiveDTO;
import io.finer.erp.jeecg.finance.entity.FinaPayment;
import io.finer.erp.jeecg.finance.vo.FinaPaymentPage;
import io.finer.erp.jeecg.finance.vo.FinaPaymentSumPage;
import io.finer.erp.jeecg.finance.vo.FinaReceiptSumVO;

/**
 * @Description: 付款表
 * @Author: jeecg-boot
 * @Date:   2021-03-22
 * @Version: V1.0
 */
public interface FinaPaymentMapper extends BaseMapper<FinaPayment> {
    /*
     *  应付/已付列表
     * @author libaow
     * @date 2021/4/21 9:19
     * @param page
     */
	List<FinaPaymentPage> getPaymentPage(@Param("createTimeStart") String createTimeStart,
							            @Param("createTimeEnd")String createTimeEnd,
							            @Param("supplierName")String supplierName,
							            @Param("receivablesEnd")BigDecimal receivablesEnd,@Param("receivablesStart")BigDecimal receivablesStart,
							            @Param("receivedsEnd")BigDecimal receivedsEnd,@Param("receivedsStart")BigDecimal receivedsStart,
							            @Param("discountSumPriceEnd")BigDecimal discountSumPriceEnd,@Param("discountSumPriceStart")BigDecimal discountSumPriceStart,
							            @Param("invoicePriceStart")BigDecimal invoicePriceStart, @Param("invoicePriceEnd")BigDecimal invoicePriceEnd);



    /*
     * 列表金额合计
     * @author libaow
     * @date 2021/4/22 16:12
     * @param page
     * @param createTimeStart
     * @param createTimeEnd
     * @param customerName
     */
	List<FinaPaymentPage> getReceiptPageSum(
            @Param("createTimeStart")String createTimeStart,
            @Param("createTimeEnd")String createTimeEnd,
            @Param("supplierName")String supplierName,
            @Param("receivablesEnd")Integer receivablesEnd,@Param("receivablesStart")Integer receivablesStart,
            @Param("receivedsEnd")Integer receivedsEnd,@Param("receivedsStart")Integer receivedsStart,
            @Param("discountSumPriceEnd")Integer discountSumPriceEnd,@Param("discountSumPriceStart")Integer discountSumPriceStart,
            @Param("invoicePriceEnd")Integer invoicePriceEnd ,@Param("invoicePriceStart")Integer invoicePriceStart);


    /*
     * 付款汇总列表
     * @author libaow
     * @date 2021/4/21 9:19
     * @param page
     */
    Page<FinaPaymentSumPage> getPaymentSumPage(IPage<FinaPaymentSumPage> page,
                                               @Param("createTimeStart") String createTimeStart,
                                               @Param("createTimeEnd")String createTimeEnd,
                                               @Param("supplierName")String supplierName);

    Page<FinaPaymentPage> getPaymentFKPage(IPage<FinaPaymentPage> page);


    List<FinaPaymentDto> getPaymentSumExcel(@Param("createTimeStart") String createTimeStart,
            @Param("createTimeEnd")String createTimeEnd,
            @Param("supplierName")String supplierName);

    FinaReceiptSumVO getamountFK();

    FinaPaymentPage getTotalOwed(@Param("supplierId")String supplierId, @Param("supplierName")String supplierName, 
                                 @Param("createTimeStart")String createTimeStart);

    List<FinaFurlDTO> getFinaFurlDTO(@Param("supplierId") String supplierId,
						            @Param("createTimeStart") String createTimeStart,
						            @Param("createTimeEnd") String createTimeEnd,
						            @Param("salesType")String salesType,
						            @Param("code")String code,
						            @Param("productName")String productName,
						            @Param("viceQtyStart")Integer viceQtyStart,
                                    @Param("viceQtyEnd")Integer viceQtyEnd,
						            @Param("qtyStart")BigDecimal qtyStart,
						            @Param("qtyEnd")BigDecimal qtyEnd,
						            @Param("unitPriceStart")BigDecimal unitPriceStart,
						            @Param("unitPriceEnd")BigDecimal unitPriceEnd,
						            @Param("totalPriceStart")BigDecimal totalPriceStart,
						            @Param("totalPriceEnd")BigDecimal totalPriceEnd,
						            @Param("totalAmountStart")BigDecimal totalAmountStart,
						            @Param("totalAmountEnd")BigDecimal totalAmountEnd,
						            @Param("hxPriceStart")BigDecimal hxPriceStart,
						            @Param("hxPriceEnd")BigDecimal hxPriceEnd,
						            @Param("zkPriceStart")BigDecimal zkPriceStart,
						            @Param("zkPriceEnd")BigDecimal zkPriceEnd,
						            @Param("qkPriceStart")BigDecimal qkPriceStart,
						            @Param("qkPriceEnd")BigDecimal qkPriceEnd,
						            @Param("remark")String remark);



	IPage<FinaPayment> paymentList(Page<FinaPayment> page, @Param("map")Map<String, Object> map);



	/**
	 * @Description 
	 * @param supplierId
	 * @return
	 * Create at: 2021-06-17 14:06:23
	 * @author: duany
	 * Revision:
	 *    2021-06-17 14:06:23 - first revision by duany
	 *        
	 */
	List<ReceiveDTO> getSupplierReceive(@Param("supplierId")String supplierId);
	
	
	/**
	 * @Description 收货单
	 * @param supplierId,createTimeStart,salesType,code,productName,qtyStart,qtyEnd,unitPriceStart
	 * @param unitPriceEnd,totalPriceStart,totalPriceEnd,totalAmountStart,totalAmountEnd
	 * @param hxPriceStart,hxPriceEnd,zkPriceStart,zkPriceEnd,qkPriceStart,qkPriceEnd,remark
	 * @return
	 * Create at: 2021-06-21 09:03:42
	 * @author: xzs
	 * Revision:
	 *    2021-06-21 09:03:42 - first revision by xzs
	 *
	 */
    List<FinaFurlDTO> getQCFinaFurlDTO(@Param("supplierId") String supplierId,
							            @Param("createTimeStart") String createTimeStart,
							            @Param("salesType")String salesType,
							            @Param("code")String code,
							            @Param("productName")String productName,
							            @Param("viceQtyStart")Integer viceQtyStart,
	                                    @Param("viceQtyEnd")Integer viceQtyEnd,
							            @Param("qtyStart")BigDecimal qtyStart,
							            @Param("qtyEnd")BigDecimal qtyEnd,
							            @Param("unitPriceStart")BigDecimal unitPriceStart,
							            @Param("unitPriceEnd")BigDecimal unitPriceEnd,
							            @Param("totalPriceStart")BigDecimal totalPriceStart,
							            @Param("totalPriceEnd")BigDecimal totalPriceEnd,
							            @Param("totalAmountStart")BigDecimal totalAmountStart,
							            @Param("totalAmountEnd")BigDecimal totalAmountEnd,
							            @Param("hxPriceStart")BigDecimal hxPriceStart,
							            @Param("hxPriceEnd")BigDecimal hxPriceEnd,
							            @Param("zkPriceStart")BigDecimal zkPriceStart,
							            @Param("zkPriceEnd")BigDecimal zkPriceEnd,
							            @Param("qkPriceStart")BigDecimal qkPriceStart,
							            @Param("qkPriceEnd")BigDecimal qkPriceEnd,
							            @Param("remark")String remark);
	/**
	* @Description 收货汇总
	* @param createTimeStart
	* @param createTimeEnd
	* @param categoryIds
	* @return
	* Create at: 2021-06-17 15:15:38
	* @author: xzs
	* Revision:
	*    2021-06-17 15:15:38 - first revision by xzs
	*
	*/
	List<FinaFurlSumDTO> getFurlSumList(@Param("createTimeStart") String createTimeStart,
	        @Param("createTimeEnd") String createTimeEnd,
	        @Param("categoryIds")String[] categoryIds);
	
	FinaFurlSumDTO getFurlSum(@Param("createTimeStart") String createTimeStart,
	@Param("createTimeEnd") String createTimeEnd,
	@Param("categoryIds")String[] categoryIds);
	
	/**
	* @Description 收货明细汇总
	* @param createTimeStart
	* @param createTimeEnd
	* @param categoryName
	* @return
	* Create at: 2021-06-17 15:16:01
	* @author: xzs
	* Revision:
	*    2021-06-17 15:16:01 - first revision by xzs
	*
	*/
	List<FinaFurlEntryDTO> getFurlEntrySum( @Param("createTimeStart")String createTimeStart,
	@Param("createTimeEnd")String createTimeEnd, @Param("categoryName")String categoryName);



	/**
	 * @Description 
	 * @param supplierId
	 * @param entryIds
	 * @return
	 * Create at: 2021-06-19 17:52:27
	 * @author: duany
	 * Revision:
	 *    2021-06-19 17:52:27 - first revision by duany
	 *        
	 */
	List<ReceiveDTO> getSupplierReceive(@Param("supplierId")String supplierId, @Param("entryIds")List<String> entryIds);



	/**
	 * @Description 
	 * @param map
	 * Create at: 2021-06-21 17:36:00
	 * @author: duany
	 * Revision:
	 *    2021-06-21 17:36:00 - first revision by duany
	 *        
	 */
	PaymentStatisticDTO getPaymentStatistic(@Param("map") Map<String, Object> map);
	
	/**
	 * @Description 期初未开票
	 * @param supplierId
	 * @param supplierName
	 * @param createTimeStart
	 * @return
	 * Create at: 2021-06-22 18:00:36
	 * @author: xzs
	 * Revision:
	 *    2021-06-22 18:00:36 - first revision by xzs
	 *
	 */
	FinaPaymentPage getNoneInvoice(@Param("supplierId")String supplierId, @Param("supplierName")String supplierName, 
            @Param("createTimeStart")String createTimeStart);
}
